<?php
if(!isset($_REQUEST['report']) || !isset($_REQUEST['cid']) || !isset($_REQUEST['path'])) die('Invalid usage - missing param');
$cid = $_REQUEST['cid'];
$path = $_REQUEST['path'];
$report = $_REQUEST['report'];

define('CID', $cid);
define('READ_ONLY_SESSION',true);
require_once('../../../include.php');
ModuleManager::load_modules();

$start_date = Module::static_get_module_variable($path, 'start_date', null);
$end_date = Module::static_get_module_variable($path, 'end_date', null);
$counselor = Module::static_get_module_variable($path, 'counselor', null);

$records = SCTV_RequirementCommon::get_report_marketing_counselor(strtotime($start_date), strtotime($end_date), $counselor);

if ($start_date===null || $end_date===null || $records === null) {
	die('Invalid usage - missing param');
}
SCTV_ReportsCommon::export($report, $records);
?>
